import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'HomeView',
      redirect: "/StoreHome",
      component: ()=> import("../views/HomeView/index.vue"),
      children:[
        {
          path: "/StoreHome", //此处是对应首页商城页面
          name: "StoreHome",
          component: ()=> import("../views/StoreHome/index.vue")
        },
        //此处对应的是我的页面内容
        {
          path: "/MyView",
          name: "MyView",
          component: ()=> import("../views/MyView/index.vue")
        },
      ]
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
  ],
})

export default router
